namespace FineCollection.Intf
{
    /// <summary>
    /// A list (write enabled).
    /// </summary>
    /// <typeparam name="T">type of an item.</typeparam>
    public interface WRandomList<T> : RRandomList<T>, WList<T>
    {

        /// <summary>
        /// Represents a quick writeable indexed access to the specified item.
        /// </summary>
        /// <remarks>
        /// The given index must be in [ FirstIndex .. LastIndex ] exclusively.
        /// </remarks>
        /// <param name="index">index of item to access.</param>
        /// <exception cref="CollectionIsEmptyException">when the collection is empty.</exception>
        /// <exception cref="IndexOutOfBoundsException">when index is incorrect.</exception>
        /// <seealso cref="RRandomList{T}.FirstIndex"/>
        /// <seealso cref="RRandomList{T}.LastIndex"/>
        new T this[int index] { get; set; }


        ///<summary>
        /// Inserts the specified item into the specified position.
        ///</summary>
        /// <remarks>
        /// After the operation completed, 
        /// the specified item will be at the specified postion.
        /// Items were at this and next positions will be shifted right.
        /// </remarks>
        ///<param name="index"></param>
        ///<param name="item"></param>
        void IncludeAt(int index, T item);


        /// <summary>
        /// Excludes the specified by index item from the collection and returns it.
        /// </summary>
        /// <param name="index">index of item to exclude.</param>
        /// <returns>just excluded item.</returns>
        T ExcludeAt(int index);
    }
}